package com.example.core.filter;

import com.example.core.context.GatewayContext;

/**
 * @Author Peng Yisheng
 * @Date 2024/12/1 21:29
 * @Description 过滤器顶级接口
 */
public interface Filter {
    void doFilter(GatewayContext ctx) throws Exception;

    default int getOrder() {
        FilterAspect annotation = this.getClass().getAnnotation(FilterAspect.class);
        if (annotation != null) {
            return annotation.order();
        }
        return Integer.MAX_VALUE;
    }
    
}
